//Application.h - Class Application

#ifndef _APPLICATION_H_
#define _APPLICATION_H_

#include "Menu.h"
#include "Rect.h"
#include "Circle.h"
#include "Shape.h"
#include "ShapeCont.h"
#include "Animate.h"
#include <conio.h>
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

class Application
{
private:
	Menu m_menu;	//main menu
	Menu m_subMenu;	//sub menu
	Menu m_shapeTypeMenu; //shae type menu
	Menu m_filesMenu; // file type menu
	ShapeCont m_shapeCont; //the shapes container
	Animate m_animate;	//the animations calass
	bool m_isFullFill;	//default type of the rectanlges
	string m_fName;;
	bool m_isBinary;
	ifstream m_inFile;	//file for read
	ofstream m_outFile;	//file for write

	void init();
	void addShape();
	Rect* getRectFromUser();
	Circle* getCircleFromUser();
	void changeShapeFill();
	void clearReadBuffer();
	void drawAllShapes();
	void markShape();
	void pressKeyReturnMainMenu();
	void runSubMenu(unsigned int idxSpecial);
	bool moveShape(unsigned int index);
	bool addAnimate(unsigned int index);
	// void InjectTestData(); //tes function - for debuging only
	void getFilFromUser();
	void saveToFile();
	void loadFromFile();
	bool openReadFile();
	bool openWriteFile();
	string fixFuffixToFileName() const;
public:
	Application();
	void run();
	~Application() {};
};

#endif